﻿using System;
using log4net;

namespace ThePingMaster
{
    public class Log4NetLogger : ILogger
    {
        private static readonly ILog Logger = LogManager.GetLogger(typeof(Log4NetLogger));

        static Log4NetLogger()
        {
            log4net.Config.XmlConfigurator.Configure();
        }

        #region Implementation of ILogger

        public void Info(string message)
        {
            Logger.Info(message);
        }

        public void Warning(string message)
        {
            Logger.Warn(message);
        }

        public void Error(string message)
        {
            Logger.Error(message);
        }

        public void Error(string message, Exception ex)
        {
            Logger.Error(message, ex);
        }

        public void Fatal(string message)
        {
            Logger.Fatal(message);
        }

        public void Fatal(string message, Exception ex)
        {
            Logger.Fatal(message, ex);
        }

        #endregion
    }
}
